package com.freight.system.feign;

import com.freight.system.service.ISysConfigService;
import com.freight.tws.api.RemoteConfigClient;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/config/client" )
public class ConfigClient implements RemoteConfigClient {

    @Autowired
    ISysConfigService sysConfigService;

    /**
     * 根据键名查询参数配置信息
     * @param configCode
     * @return
     */
    @PostMapping(value = "/selectConfigByKey")
    @Override
    public String selectConfigByKey(@RequestParam("configCode")String configCode){
        return sysConfigService.selectConfigByKey(configCode);
    }

}
